Skip to content

Conversation

kmvanbrunt
Copy link
Member

@kmvanbrunt kmvanbrunt commented Aug 18, 2025

Refactored cmd2 to better account for our use of Rich.

* Added string_utils.py which contains all string utility functions.
  This includes quoting and alignment functions from utils.py.
  This also includes style-related functions from ansi.py.

* Added colors.py which contains a StrEnum of all color names supported by Rich.

* Added styles.py which contains a StrEnum of all cmd2-specific style names and their
  respective style definitions.

* Moved string styling functionality from ansi.py to string_utils.py.

* Removed all text style Enums from ansi.py since we use Rich.

* Renamed ansi.py to terminal_utils.py to reflect the functions left in it.

* Removed table_creator.py since we use Rich tables now.

kmvanbrunt and others added 4 commits August 16, 2025 23:18
* Added string_utils.py which contains all string utility functions.
  This includes quoting and alignment functions from utils.py.
  This also includes style-related functions from ansi.py.

* Added colors.py which contains all color names supported by Rich.

* Added styles.py which contains the names of all cmd2-specific styles.

* Moved string styling functionality from ansi.py to string_utils.py.

* Removed all text style Enums from ansi.py since we use Rich.

* Renamed ansi.py to terminal_utils.py to reflect the functions left in it.

* Removed table_creation.py since we use Rich tables now.
Copy link

codecov bot commented Aug 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@db2654c). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1477   +/-   ##
=======================================
  Coverage        ?   98.50%           
=======================================
  Files           ?       23           
  Lines           ?     4884           
  Branches        ?        0           
=======================================
  Hits            ?     4811           
  Misses          ?       73           
  Partials        ?        0           
Flag Coverage Δ
unittests 98.50% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@tleonhardt tleonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks really good. Just requesting some minor changes for ease of maintainability.

tleonhardt
tleonhardt previously approved these changes Aug 18, 2025
Copy link
Member

@tleonhardt tleonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

In the future we'll need to spend some more time updating the documentation for all of these changes. But this looks good for now.

tleonhardt
tleonhardt previously approved these changes Aug 18, 2025
@kmvanbrunt kmvanbrunt merged commit 2ef7b9a into main Aug 19, 2025
30 checks passed
@kmvanbrunt kmvanbrunt deleted the refactoring branch August 19, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants